package org.niugang.security.users.web;

import io.swagger.annotations.Api;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 权限测试
 *
 * @author Created by niugang on 2019/5/24/16:49
 */
@RestController
@RequestMapping("permission")
@Api(value = "权限接口", tags = {"权限配置接口"})
public class PermissionController {


    @GetMapping
    @PreAuthorize("hasAuthority('admin')")
    public ResponseEntity<String> permissionTest() {

        return ResponseEntity.ok("调用后台接口权限测试");
    }
}
